$('#join_form').submit(function (event) {
	$.ajax({
		type: 'POST',
		url: 'http://' + serverIP + ':8888/joinRoom',
		data: { 'chat_name' : $("#crTitle").text(), 'create_room' : true },
		dataType: 'json',
		
		success: function(data) {
                    if(data.errMsg) {
                        alert(errMsg);
                    } else {
                        tempName = $("#crTitle").text();
			$('#startsida-content').css('top', '20%');			
			$('#startsida-content').load('chat-room.html');
			//active_chatrooms.push(data.id);
			//another_chatrooms.push({ id: data.id, color: 1 });
                    }
                },
		error: function(xhr, status, error) {
				console.log('Join failed');
		}
	});
	event.preventDefault();
});
